<!--添加成员-->
<template>
    <div class="addMembersWrap">
        <Head :title="title" BackType1="1" NoticeType3="1"></Head>
        <div class="content">
            <Search placeholder="搜索ID/名称"></Search>

            <p class="infoSec" v-if="!group">已添加成员（12）</p>
            <div class="added" v-if="!group">
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="user">
                    <img src="../assets/img/messageAvatar.png" class="avatar">
                    <p class="name">小林同学</p>
                </div>
                <div class="last"></div>
            </div>
            <p class="infoSec" v-if="!group">我的好友（381）</p>
            <!--我的所有好友-->
            <div class="allFriends" :class="{'groupAdd':group}">
                <!--一个字母开头的模块-->
                <van-checkbox-group v-model="result">
                    <div class="col">
                        <p class="letter"><span class="active">群主、管理员</span></p>
                        <div class="friendWrap" v-for="(item, index) in list0">
                            <van-checkbox

                                :key="item"
                                :name="item"
                            >
                                <div class="friend">
                                    <img src="../assets/img/messageAvatar.png" class="avatar">
                                    <p>不二机智少年</p>
                                </div>
                            </van-checkbox>
                        </div>
                    </div>


                    <div class="col">
                        <p class="letter">A</p>
                        <div class="friendWrap" v-for="(item, index) in list">
                            <van-checkbox

                                :key="item"
                                :name="item"
                            >
                                <div class="friend">
                                    <img src="../assets/img/messageAvatar.png" class="avatar">
                                    <p>不二机智少年</p>
                                </div>
                            </van-checkbox>
                        </div>
                    </div>


                    <div class="col">
                        <p class="letter">B</p>
                        <div class="friendWrap" v-for="(item, index) in list1">
                            <van-checkbox
                                :key="item"
                                :name="item"
                            >
                                <div class="friend">
                                    <img src="../assets/img/messageAvatar.png" class="avatar">
                                    <p>不二机智少年</p>
                                </div>
                            </van-checkbox>
                        </div>


                    </div>

                    <div class="col">
                        <p class="letter">C</p>
                        <div class="friendWrap" v-for="(item, index) in list2">
                            <van-checkbox
                                :key="item"
                                :name="item"
                            >
                                <div class="friend">
                                    <img src="../assets/img/messageAvatar.png" class="avatar">
                                    <p>不二机智少年</p>
                                </div>
                            </van-checkbox>
                        </div>


                    </div>

                </van-checkbox-group>
            </div>
        </div>
        <LetterRight></LetterRight>


    </div>
</template>

<script>
    import Head from "../components/Head";
    import Search from "../components/Search";
    import LetterRight from "../components/LetterRight";
    import {Checkbox, CheckboxGroup} from 'vant';

    export default {
        data() {
            return {
                group: true,  //是否为 添加群成员样式
                groupAdmin: false,  //是否为添加管理员 (样式和添加成员样式一样)
                removeAdmin:true, //是否为移除群成员 (样式和添加成员样式一样)
                result: [],
                list0: [10, 11, 12],
                list: [1, 2, 3],
                list1: [4, 5, 6],
                list2: [7, 8, 9]
            }
        },
        components: {
            Head,
            Search,
            [Checkbox.name]: Checkbox,
            [CheckboxGroup.name]: CheckboxGroup,
            LetterRight
        },
        computed: {
            title() {
                if (this.group === true && this.groupAdmin === false && this.group === false) {
                    return "添加群成员"
                }
                if (this.group === true && this.groupAdmin === true) {
                    return "添加管理员"
                }
                if (this.group === true && this.removeAdmin === true) {
                    return "移除群成员"
                }

            }

        }
    }
</script>

<style scoped lang="less">
    .addMembersWrap {
        width: 100%;
        height: 100%;
        position: relative;
        background-color: #f1f5f8;

        .content {
            position: absolute;
            top: 88px;
            bottom: 0;
            width: 100%;
        }

        .infoSec {
            width: 100%;
            padding: 19px 42px;
            box-sizing: border-box;
            font-size: 24px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(152, 151, 148, 1);
        }


        .added {
            width: 100%;
            height: 150px;
            background-color: #ffffff;
            display: -webkit-box;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            padding-left: 40px;
            box-sizing: border-box;
            overflow: -moz-scrollbars-none;
            -ms-overflow-style: none;

            .user {
                width: 90px;
                display: flex;
                flex-direction: column;
                margin-right: 20px;
                margin-top: 13px;

                .avatar {
                    width: 90px;
                    height: 90px;
                    border-radius: 10px;
                }

                p {
                    width: 90px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    font-size: 24px;
                    font-family: PingFangSC-Regular;
                    font-weight: 400;
                    color: rgba(68, 68, 68, 1);
                    margin-top: 15px;
                    text-align: center;
                }

            }

            .last {
                width: 20px;
            }

        }

        .added::-webkit-scrollbar {
            display: none;
        }

        .added::-webkit-scrollbar {
            width: 0 !important
        }


        .allFriends {
            position: absolute;
            top: 362px;
            bottom: 0;
            width: 100%;
            background-color: #ffffff;
            overflow-x: hidden;
            overflow-y: scroll;
            -webkit-overflow-scrolling: touch;

            .col {
                width: 100%;
                padding-left: 40px;
                box-sizing: border-box;
                border-bottom: 1px solid #eee;

                .letter {
                    display: flex;
                    align-items: center;
                    width: 100%;
                    height: 55px;
                    font-size: 28px;
                    font-family: PingFangSC-Medium;
                    font-weight: 500;
                    color: rgba(85, 85, 85, 1);
                    .active {
                        color: #627df1;
                    }
                }

                .friendWrap {
                    border-top: 1px solid #EEE;
                }

                .friend {
                    display: flex;
                    align-items: center;
                    width: 618px;
                    height: 130px;
                    margin-left: 30px;

                    .avatar {
                        width: 90px;
                        height: 90px;
                        border-radius: 50%;
                        margin-right: 21px;
                    }

                    p {

                    }
                }

            }
        }

        .groupAdd {
            top: 90px;

            .col {
                position: relative;
                padding-top: 66px;

                .letter {
                    width: 750px;
                    height: 66px;
                    background-color: #f2f5f8;
                    position: absolute;
                    left: 0;
                    top: 0;
                    padding-left: 25px;
                    box-sizing: border-box;
                }

                .friendWrap {
                    border-top: none;
                    border-bottom: 1px solid #EEE;
                }
            }
        }

    }
</style>
